Type alias: NodeHTTPHandlerOptions<TRouter, TRequest, TResponse>
NodeHTTPHandlerOptions: <
TRouter,TRequest,TResponse>HTTPBaseHandlerOptions<TRouter,TRequest> &NodeHTTPCreateContextOption<TRouter,TRequest,TResponse> & {experimental_contentTypeHandlers:NodeHTTPContentTypeHandler<TRequest,TResponse>[];maxBodySize:number;middleware:ConnectMiddleware;}
NodeHTTPHandlerOptions.experimental_contentTypeHandlers
optionalexperimental_contentTypeHandlers:NodeHTTPContentTypeHandler<TRequest,TResponse>[]NodeHTTPHandlerOptions.maxBodySize
optionalmaxBodySize:numberNodeHTTPHandlerOptions.middleware
optionalmiddleware:ConnectMiddlewareBy default, http
OPTIONSrequests are not handled, and CORS headers are not returned.This can be used to handle them manually or via the
corsnpm package: https://www.npmjs.com/package/corstsimport cors from 'cors'nodeHTTPRequestHandler({cors: cors()})tsimport cors from 'cors'nodeHTTPRequestHandler({cors: cors()})You can also use it for other needs which a connect/node.js compatible middleware can solve, though you might wish to consider an alternative solution like the Express adapter if your needs are complex.
Type parameters
| Parameter |
|---|
TRouter extends AnyTRPCRouter |
TRequest extends NodeHTTPRequest |
TResponse extends NodeHTTPResponse |
Source
packages/server/src/adapters/node-http/types.ts:69
Generated using TypeDoc and typedoc-plugin-markdown